package com.changgou.content.feign;
import com.changgou.content.pojo.Content;
import com.changgou.entity.Result;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/****
 * @Author:shenkunlin
 * @Description:
 * @Date 2019/6/18 13:58
 *****/
@FeignClient(name="content")
@Component
public interface ContentFeign {

    /**
     *  TODO    根据分类ID查询所有广告
     * @param: [categoryId]  TODO [ ]
     * @return: com.changgou.entity.Result<java.util.List<com.changgou.content.com.changgou.seckill.pojo.Content>>
     * @Author: YPK
     * @Date: 2019/11/15  0:50
     * @Version: 1.0
     **/
    @GetMapping(value = "/list/category/{categoryId}")
    Result<List<Content>> findByCategoryId(@PathVariable("categoryId") Long categoryId);

    /***
     * 多条件搜索品牌数据
     * @param content
     * @return
     */
    @PostMapping(value = "/search" )
    Result<List<Content>> findList(@RequestBody(required = false) Content content);

    /***
     * 根据ID删除品牌数据
     * @param id
     * @return
     */
    @DeleteMapping(value = "/{id}" )
    Result delete(@PathVariable("id") Long id);

    /***
     * 修改Content数据
     * @param content
     * @param id
     * @return
     */
    @PutMapping(value="/{id}")
    Result update(@RequestBody Content content, @PathVariable("id") Long id);

    /***
     * 新增Content数据
     * @param content
     * @return
     */
    @PostMapping
    Result add(@RequestBody Content content);

    /***
     * 根据ID查询Content数据
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<Content> findById(@PathVariable("id") Long id);

    /***
     * 查询Content全部数据
     * @return
     */
    @GetMapping("/content")
    Result<List<Content>> findAll();
}